package com.learn.thread.local;

public class Test {
    public static void main(String[] args) {
        new Thread(new Runnable() {

            ThreadLocal<String> threadLocal = new ThreadLocal<String>();

            @Override
            public void run() {
                threadLocal.set("hello");

                new Thread(new Runnable(){

                    @Override
                    public void run() {
                        System.out.println(threadLocal.get());
                    }
                }).start();

                System.out.println(threadLocal.get());

            }
        }).start();

    }
}
